'use strict' import { getBotVersions } from '../storageService' import { WrongInputError, NotFoundError, InternalError } from '../../../utils/customErrors' import { Request } from 'express' /** * Operations on /bots/{id}/versions */ export default { /**Returns a bot based on a single ID */ async getVersions(req: Request) { if (req.params.id) { try { return await getBotVersions(req.params.id) } catch (error) { throw new NotFoundError(error) } } else { throw new WrongInputError('version id is undefined') } } }